class ConfigModel:
    def __init__(self, config):
        self.apiKey = config['apiKey']
        self.secretKey = config['secretKey']

        # 是否开启测试环境
        self.testnet = config['testnet'] if 'testnet' in config else False
        self.asset = config.get('secretKey', 'USDT') # 默认使用兑换币种

        self.dingding = DingdingModel(config['dingding'])


class DingdingModel:
    def __init__(self, config={}):
        self.webhook = config['webhook']
        self.atMobiles = config['atMobiles']

        self.agentId = config['agentId']
        self.appKey = config['appKey']
        self.appSecret = config['appSecret']

    def setLogger(self, logger):
        self.logger = logger
